﻿<%@ Page Language="C#" Inherits="Deepcode.Flux.Core.UI.CMS.CMSContentForm" ValidateRequest="false"%>
<%@ Register TagPrefix="flux" Namespace="Deepcode.Flux.Core.UI.Controls" Assembly="Deepcode.Flux.Core"%>

<script runat="server">
	// Type ID being managed by this form
	protected override string FormTypeCode { get { return "Channel"; } }

	// Do form setup
	protected override void SetupForm(int ContentID, int ParentID)
	{
		if (!Page.IsPostBack)
		{
			fPath.NodeIDParent = ParentID;
			fPath.NodeIDPathed = ContentID;
		}
	}

	// Save fields to content object
	protected override void SaveContent(ref Deepcode.Flux.Core.Systems.CMS.ContentObject save)
	{
		save.NodeName = this.fPath.Text;
		save.NodeTitle = this.fPageTitle.Text;
	}

	// Load fields from content object
	protected override void LoadContent(Deepcode.Flux.Core.Systems.CMS.ContentObject load)
	{
		this.fPath.Text = load.NodeName;
		this.fPageTitle.Text = load.NodeTitle;
	}
</script>

<html>
<head id="Head1" runat="server">
    <link href="../../../admin/Asset/Style/GeneralStyle.css" rel="Stylesheet" type="text/css" />
</head>
<body class="nopadshaded">
<form id="form1" runat="server">
<flux:HostTable ID="HostTable1" runat="server">

<%-- Summary --%>
<flux:ValidationSummarySection ID="ValidationSummarySection1" runat="server" HeaderText="Please correct the following errors"/>

<%-- Form area --%>
    <flux:Section ID="Section1" runat="server" Title="Add/Edit Content Channel">
    <flux:ShadePadBox ID="ShadePadBox1" runat="server">

	    <table cellspacing="0" cellpadding="3" border="0">
        <tr><td>Path:</td>
            <td><flux:NodePath runat="server" ID="fPath" Width="200px" MaxLength="100"/></td>
            </tr>

	    <tr><td>Page Title:</td>
		    <td><asp:TextBox runat="server" ID="fPageTitle" Width="300px" MaxLength="500"/></td>
		    </tr>
		</table>

    </flux:ShadePadBox>
    </flux:Section>

<%-- Buttons --%>
<flux:Section ID="Section3" runat="server">
<flux:PadBox ID="PadBox1" CssClass="Pad5Button" runat="server">
	<asp:Button runat="server" ID="btnSave" Text="Save" OnClick="btnSave_Click" CssClass="button"/>&nbsp;&nbsp;&nbsp;
	<asp:Button runat="server" ID="btnCancel" Text="Cancel" OnClick="btnCancel_Click" CausesValidation="False"/>
</flux:PadBox>
</flux:Section>

<%-- Validators --%>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="fPath"
    ErrorMessage="You must specify the path for this page" Display="None"/>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" Runat="server" ControlToValidate="fPageTitle" 
	ErrorMessage="You must specify the title of this page" Display="None"/>


</flux:HostTable>

</form>
</body>
</html>
